//
//  ZH_TopUpImageTableViewCell.m
//  WisdomStar
//
//  Created by zhangliwen on 2018/10/22.
//  Copyright © 2018年 zhangliwen. All rights reserved.
//

#import "ZH_TopUpImageTableViewCell.h"
@interface ZH_TopUpImageTableViewCell()
@property (nonatomic,weak)UIImageView *topImage;
@property (nonatomic,weak)UILabel *titleLabel;
@property (nonatomic,weak)UILabel *moneyLabel;
@end
@implementation ZH_TopUpImageTableViewCell

///创建
+(instancetype)cellWithTableView:(UITableView*)tableView
{
    static NSString *ID = @"ZH_TopUpImageTableViewCell";
    ZH_TopUpImageTableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:ID];
    if(cell == nil){
        cell = [[ZH_TopUpImageTableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:ID];
    }
    return cell;
}
///初始化
-(void)initDefault
{
    [self unShowClickEffect];
    //    self.bottomShortLineImage.hidden = NO;
}
- (void)loadSubviewConstraints{
    [self.topImage mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.left.right.bottom.equalTo(self.contentView);
    }];
    [self.titleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerX.equalTo(self.contentView);
        make.top.equalTo(self.contentView).offset(FITSCALE(47));
    }];
    [self.moneyLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerX.equalTo(self.contentView);
        make.top.equalTo(self.titleLabel.mas_bottom).offset(FITSCALE(10));
    }];
}
#pragma mark - getter,setter
- (UIImageView *)topImage{
    if (!_topImage) {
        UIImageView *image = [UIImageView createImageViewWithName:@"img_pay_bg"];
        [self.contentView addSubview:_topImage = image];
    }
    return _topImage;
}
- (UILabel *)titleLabel{
    if (!_titleLabel) {
        UILabel *label = [UILabel createLabelWithText:@"当前余额" font:kFontSize_30];
        label.textColor = [UIColor colorWithHexString:@"#E6E6E6"];
        [self.contentView addSubview:_titleLabel = label];
    }
    return _titleLabel;
}
- (UILabel *)moneyLabel{
    if (!_moneyLabel) {
        UILabel *label = [UILabel createLabelWithText:@"100元" font:kFontSize_34];
        label.textColor = kFontColorWhite;
        [self.contentView addSubview:_moneyLabel = label];
    }
    return _moneyLabel;
}

@end
